from django.db import models
from django.contrib.auth.models import AbstractUser


# Create your models here.
class User(AbstractUser):
    mobile = models.CharField(max_length=11, unique=True, verbose_name="学号")
    grade = models.CharField(max_length=4, unique=False, verbose_name="年级")
    user_college = models.CharField(max_length=20, default='人工智能与大数据学院', unique=False, verbose_name="所属学院")
    professional = models.CharField(max_length=20, default='False', unique=False, verbose_name="专业")
    user_class = models.IntegerField(default=1, verbose_name="班级")
    number = models.IntegerField(default=0, verbose_name="所借书籍数量")
    borrow_number = models.IntegerField(default=0, unique=False, verbose_name="已还书本的数量")
    is_deleted = models.BooleanField(default=False, verbose_name='逻辑删除')

    class Meta:
        db_table = 'db_users'  # 自定义表名
        verbose_name = '用户'
        verbose_name_plural = verbose_name

    # def __str__(self):
    #     return self.username
